﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Entity;

namespace BIZ
{
    public class Menu_l2BIZ
    {
        Menu_l2DAL DAL = new Menu_l2DAL();

        //---------------------Menu_l2SearchById-----------------------------
        public List<objMenu_l2> Menu_l2SearchById(int id)
        {
            try
            {
                List<objMenu_l2> lst = new List<objMenu_l2>();
                lst = DAL.Menu_l2SearchById(id);

                return lst;
            }
            catch (Exception)
            {
                throw;
            }
        }

        //---------------------Menu_l2SearchById_l1-----------------------------
        public List<objMenu_l2> Menu_l2SearchById_l1(int id_l1)
        {
            try
            {
                List<objMenu_l2> lst = new List<objMenu_l2>();
                lst = DAL.Menu_l2SearchById_l1(id_l1);

                return lst;
            }
            catch (Exception)
            {
                throw;
            }
        }

        //---------------------Menu_l2Insert-----------------------------
        public int Menu_l2Insert(int id_l1, string name, int position)
        {
            try
            {
                int i = DAL.Menu_l2Insert(id_l1, name, position);

                return i;
            }
            catch (Exception)
            {
                throw;
            }
        }

        //---------------------Menu_l2Update-----------------------------
        public int Menu_l2Update(int id, int id_l1, string name, int position)
        {
            try
            {
                int i = DAL.Menu_l2Update(id, id_l1, name, position);

                return i;
            }
            catch (Exception)
            {
                throw;
            }
        }

        //---------------------Menu_l2Delete-----------------------------
        public int Menu_l2Delete(int id)
        {
            try
            {
                int i = DAL.Menu_l2Delete(id);

                return i;
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}
